// --------------------------------------------------------------------------------------------------------------------- 
// <copyright file="AuthenticationHandler.cs" company="">
//   
// </copyright>
// <summary>
//   Defines the AuthenticationHandler type.
// </summary>
// ---------------------------------------------------------------------------------------------------------------------
namespace FacebookTest
{
    using System.Diagnostics;
    using Facebook.Fluent;

    /// <summary>
    /// Logs in to facebook using internet explorer to get a session key.
    /// </summary>
    public class AuthenticationHandler : IAuthenticationHandler
    {
        #region Implementation of IAuthenticationHandler

        /// <summary>
        /// Authenticates the user.
        /// </summary>
        /// <param name="uri">The URI for the login page.</param>
        public void AuthenticateUser(string uri)
        {
            Process process = new Process();
            process.StartInfo = new ProcessStartInfo("iexplore.exe", uri);
            process.Start();
            process.WaitForExit();
        }

        #endregion
    }
}